package com.project.personnel.service.impl;

import com.project.personnel.entity.Department;
import com.project.personnel.dao.DepartmentMapper;
import com.project.personnel.service.DepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author diaominyh
 * @since 2022-12-12
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    @Resource
    private DepartmentMapper departmentMapper;
    @Override
    public List<Department> listDempartment(String name) {
        return departmentMapper.listDempartment(name);
    }

    @Override
    public int deleteDepartment(Integer parentId) {
        return departmentMapper.deleteDepartment(parentId);
    }

    @Override
    public Integer list(Integer id) {
        return departmentMapper.list(id);
    }

    @Override
    public List<Department> listDep(Integer parentId) {
        return departmentMapper.listDep(parentId);
    }

    @Override
    public Department department(Integer id) {
        return departmentMapper.department(id);
    }
}
